/****************************************************************
 * Fulguro
 * Copyright (C) 2004 Christophe Clienti
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 ***************************************************************/

#ifdef __cplusplus
extern "C" {
#endif


#ifndef __FLGR_IMAGE_IO_H
#define __FLGR_IMAGE_IO_H

#include <flgrCoreDll.h>
#include <flgrCoreErrors.h>
#include <flgrCoreTypes.h>
#include <flgrCoreData.h>

  EXPORT_LIB char *flgr_get_supported_image_format(void);

  EXPORT_LIB int flgr_check_extension(char *filename, char *extToCheck);
  EXPORT_LIB char *flgr_set_extension(char *filename, char *ext);

  EXPORT_LIB FLGR_Data2D *flgr2d_load_raw_file(char *filename, int byte_offset, int size_y, int size_x, int spp, FLGR_Type type);
  EXPORT_LIB FLGR_Data2D *flgr2d_load_raw_desc(FILE *f, int byte_offset, int size_y, int size_x, int spp, FLGR_Type type);

  EXPORT_LIB FLGR_Data2D *flgr2d_load_text_file(char *filename, int size_y, int size_x, int spp, FLGR_Type type);
  EXPORT_LIB FLGR_Data2D *flgr2d_load_text_desc(FILE *f, int size_y, int size_x, int spp, FLGR_Type type);

  EXPORT_LIB FLGR_Data2D *flgr2d_load_pgm(char *filename);
  EXPORT_LIB FLGR_Data2D *flgr2d_load_bmp(char *filename);
  EXPORT_LIB FLGR_Data2D *flgr2d_load_png(char *filename);
  EXPORT_LIB FLGR_Data2D *flgr2d_load_jpeg(char *filename);
  EXPORT_LIB FLGR_Data2D *flgr2d_load_tiff(char *filename);
  EXPORT_LIB char *flgr2d_load_tiff_info(char *filename);

  EXPORT_LIB FLGR_Ret flgr2d_save_raw_desc(FLGR_Data2D *dat, FILE *f);
  EXPORT_LIB FLGR_Ret flgr2d_save_text_desc(FLGR_Data2D *dat, FILE *f);
  
  EXPORT_LIB FLGR_Ret flgr2d_save_png(FLGR_Data2D *img, char *filename);
  EXPORT_LIB FLGR_Ret flgr2d_save_pgm(FLGR_Data2D *img, char *filename, int format);
  EXPORT_LIB FLGR_Ret flgr2d_save_jpeg(FLGR_Data2D *img, char *filename, int quality);
  EXPORT_LIB FLGR_Ret flgr2d_save_tiff(FLGR_Data2D *img, char *filename, int quality);


#endif

#ifdef __cplusplus
}
#endif
